export function loadCartList(uid){
	return new Promise(function(resolve, reject) {
		uni.request({
			url: "/cart/list",
			data:{uid:uid},
			success(res) {
				resolve(res);
			},
			fail(err) {
				reject(err);
			}
		})
	})
}
export function addCart(cart){
	return new Promise(function(resolve, reject) {
		uni.request({
			url: "/cart/add",
			data:cart,
			success(res) {
				resolve(res.data);
			},
			fail(err) {
				reject(err);
			}
		})
	})
}
export function count(uid){
	return new Promise(function(resolve, reject) {
		uni.request({
			url: "/cart/count",
			data:{uid},
			success(res) {
				resolve(res.data);
				console.log("uid2",uid)
			},
			fail(err) {
				reject(err);
			}
		})
	})
}
export function delectCart(cartId){
	return new Promise(function(resolve, reject) {
		uni.request({
			url: "/cart/delect",
			data:{cartId},
			success(res) {
				resolve(res.data);
				console.log("cartId2",cartId)
			},
			fail(err) {
				reject(err);
			}
		})
	})
}
export function updateCart(cartId,numbers){
	return new Promise(function(resolve, reject) {
		uni.request({
			url: "/cart/update",
			data:{cartId:cartId,numbers:numbers},
			success(res) {
				resolve(res.data);
				console.log("cartId2",cartId)
				console.log("numbers",numbers)
			},
			fail(err) {
				reject(err);
			}
		})
	})
}